package DocCangAPI;

public class AAAHomeWork {
    public static void main(String[] args) {
                      //0123456789012345678901234567890123456789
        String address="https://tmooc.cn/java/demo.html?name=tom&id=5";
        String fuwuqi=address.substring(0,5);
        System.out.println(fuwuqi);//https

        int position1=address.indexOf(":");
        String tmooc=address.substring(position1,position1+11);
        System.out.println(tmooc);

        int position2=address.indexOf('j');
        int position3=address.indexOf('/',20);
        String java=address.substring(position2,position3);
        System.out.println(java);

        int position4=address.lastIndexOf('/');
        int position5=address.lastIndexOf('5');
        String lastSentence=address.substring(position4+1,position5);
        System.out.println(lastSentence);
    }
}
